package com.weds.custompage.util;

import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * @Description 分页工具类
 * @Author lihw
 * @Date 2023/9/1 10:59
 */
public class PageHelperUtil {

    public static Page startPage(int pageNum, int pageSize, String orderBy, boolean toCamelCaseFlag) {
        if (toCamelCaseFlag) {
            return PageHelper.startPage(pageNum, pageSize, StrUtil.toUnderlineCase(orderBy));
        }

        return PageHelper.startPage(pageNum, pageSize, orderBy);
    }

}
